package fileIO;

import java.io.File;
import java.io.FileFilter;

/**
 * @description: TODO
 * @author: wzj
 * @create: 2019/3/29 16:44
 */
public class FileFilterImpl implements FileFilter {
    private String keywords;
    public FileFilterImpl(String keywords){
        this.keywords=keywords;
    }
    @Override
    public boolean accept(File file) {
        if(file.isFile()){
            String filename=file.getName();
            if(filename.indexOf(keywords)>0){
                return true;
            }
        }
        return false;
    }
}
